package com.wisezone.workflow.core;

import java.util.Map;

import com.wisezone.workflow.bean.WfActivityInstance;
import com.wisezone.workflow.exception.WfCoreException;


/**
 * 活动实例对象
 * @author tss 2009-09-05
 *
 */
public interface ActivityInstance  extends BaseProperty {
	

	/**
	 * 活动开始
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance start() throws WfCoreException;
	
	/**
	 * 活动开始
	 * 
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance start(Map<String, Object> variableMap) throws WfCoreException;
	
	
	
	/**
	 * 活动实例完成
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance complete(Long actor, Long[] nextActorIds,
			Long[] nextActorGroupIds,String opinion) throws WfCoreException;
	
	
	/**
	 * 活动实例完成
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance complete(Long actor,
			Map<String, Object> activityMap,Map<String,Object> variableMap,String opinion) throws WfCoreException;
	
	/**
	 * 活动实例完成
	 * 
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance complete(Long actor, String opinion) throws WfCoreException;
	
	/**
	 * 活动结束
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance end() throws WfCoreException;
	
	public ActivityInstance end(Map<String, Object> map) throws WfCoreException ;
	
	
	
	/**
	 * 活动结束
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance end(Long [] nextActorIds,Long [] nextActorGroupIds) throws WfCoreException;
	
	
	
	/**
	 * 活动结束于给定活动名
	 * @param activityName
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance end(Long nextActivityId,Long [] nextActorIds,Long [] nextActorGroupIds) throws WfCoreException;
	
	
	
	/**
	 * 设置活动参与者
	 * @param starter
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance setActor(Long actor) throws WfCoreException ;
	
	/**
	 * 设置活动意见
	 * @param opinion
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance setOpinion(String opinion) throws WfCoreException ;
	
	/**
	 * 设置活动备注
	 * @param memo
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance setMemo(String memo) throws WfCoreException;
	
	
	/**
	 * 是否结束活动
	 * @return
	 * @throws WfCoreException
	 */
	public boolean isEnd() throws WfCoreException ;
	
	
	/**
	 * 修改
	 * @param wfActivityInstance
	 * @return
	 * @throws WfCoreException
	 */
	public ActivityInstance update(WfActivityInstance wfActivityInstance) throws WfCoreException ;
	

	/**
	 * 获得活动实例变量
	 */
	public Object getVariable(String name) throws WfCoreException;
	
	
	/**
	 * 设置活动实例变量
	 * @param name
	 * @param value
	 * @throws WfCoreException
	 */
	public void setVariable(String name,String value) throws WfCoreException;
	
	/**
	 * 获得业务状态
	 * @return
	 * @throws WfCoreException
	 */
	public Object getStatus() throws WfCoreException;
	
	public WfActivityInstance getModel();

	public void setModel(WfActivityInstance wfActivityInstance) ;

	public Activity getActivity() ;

	public void setActivity(Activity activity);

	public ProcessDefinition getProcessDefinition() ;

	public void setProcessDefinition(ProcessDefinition processDefinition) ;

	public ProcessInstance getProcessInstance() ;

	public void setProcessInstance(ProcessInstance processInstance);
	
	public Map<String, Object> getVariableMap();
	
	
	

}
